package com.jooq.example.config.db.dds;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * 动态数据源实现类
 */
public class DynamicDataSource extends AbstractRoutingDataSource {
    @Override
    protected Object determineCurrentLookupKey() {
        //从线程中获取数据源名称
        return DynamicDataSourceHolder.getDataSource();
    }
}
